﻿using Domain.Entitys.Pinv;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.IRepositorys.Pinv
{
    public interface IPoRepository
    {
        /// <summary>
        /// 条件、分页查询
        /// </summary>
        /// <param name="Po_VendorName"></param>
        /// <param name="Po_Name"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        List<Po_details_Order> GetPoFYWhere(string Po_VendorName,  string Po_Name, int currentPage, int pageSize,string proName);

        /// <summary>
        /// 条件查询总条数
        /// </summary>
        /// <param name="Po_VendorName"></param>
        /// <param name="Po_Name"></param>
        /// <returns></returns>
        int GetPoCount(string Po_VendorName, string Po_Name,string proName);
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="pinv_Po"></param>
        /// <returns></returns>
        Task<int> PostPoAdd(Pinv_Po pinv_Po,List<pinv_details> pinv_details);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="pinv_Po"></param>
        /// <returns></returns>
        Task<int> PutPoDelete(Pinv_Po pinv_Po);
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="pinv_Po"></param>
        /// <returns></returns>
        Task<int> PutPoUpdate(Pinv_Po pinv_Po, List<pinv_details> pinv_details);
        /// <summary>
        /// 根据供应商编号、昵称查询信息
        /// </summary>
        /// <param name="Po_VendorName"></param>
        /// <param name="Po_EndorCode"></param>
        /// <returns></returns>
        Task<Pinv_Po> GetPoWhere(string Po_VendorName);
        /// <summary>
        /// 根据采购订单编号查询明细
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<List<pinv_details>> Getdetailswherecode(string code);
        /// <summary>
        /// 根据code进行审核
        /// </summary>
        /// <param name="pinv_Po"></param>
        /// <returns></returns>
        Task<int> PutPoUpdateAudit(Pinv_Po pinv_Po);
        /// <summary>
        /// 采购入库查询采购订单
        /// </summary>
        /// <param name="Po_Vendor_Name"></param>
        /// <param name="Po_Code"></param>
        /// <param name="Po_State"></param>
        /// <param name="Po_Rep_Id"></param>
        /// <param name="Po_depd_id"></param>
        /// <returns></returns>
        Task<List<Pinv_Po>> GetPoWhere(string Po_Vendor_Name, string Po_Code, int Po_State, int Po_Rep_Id, int Po_depd_id,int currentPage,int pageSize);

        /// <summary>
        /// 采购入库查询采购订单总条数
        /// </summary>
        /// <param name="Po_Vendor_Name"></param>
        /// <param name="Po_Code"></param>
        /// <param name="Po_State"></param>
        /// <param name="Po_Rep_Id"></param>
        /// <param name="Po_depd_id"></param>
        /// <returns></returns>
        int GetPoWhereCount(string Po_Vendor_Name, string Po_Code, int Po_State, int Po_Rep_Id, int Po_depd_id);

        /// <summary>
        /// 根据采购订单编号已经条件查询明细
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        Task<List<pinv_details>> GetdetailswherecodeFY(string code,string procode,int unitmeas_id, int currentPage, int pageSize);
        /// <summary>
        /// 根据采购订单编号已经条件查询明细总条数
        /// </summary>
        /// <returns></returns>
        int GetdetailswherecodeFYCount(string code, string procode, int unitmeas_id);

        /// <summary>
        /// 条件、分页查询报表
        /// </summary>
        /// <param name="Po_VendorName"></param>
        /// <param name="Po_Name"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        List<Po_details_Order> GetPoFYWhereAudit(string Po_VendorName, string Po_Name, int currentPage, int pageSize);

        /// <summary>
        /// 条件查询总条数报表
        /// </summary>
        /// <param name="Po_VendorName"></param>
        /// <param name="Po_Name"></param>
        /// <returns></returns>
        int GetPoCountAudit(string Po_VendorName, string Po_Name);

        List<Po_details_Order> Po_Details_OrdersSummary(string Po_VendorName, string Po_Name, string proName);

        /// <summary>
        /// 采购订单撤销
        /// </summary>
        /// <param name="pinv_Po"></param>
        /// <returns></returns>
        Task<int> Pinv_PoRevokeAsync(Pinv_Po pinv_Po);
    }
}
